$(document).ready(function () {
    let obj = new Object();
    obj.m="getLoginMember";
    $.ajax({
        //请求方式： 同步 false 异步 true
        async:true,
        //请求方式
        type:"POST",
        //Ajax请求设置xhrFields的withCredentials为true实现跨域访问
        xhrFields:{
            withCredentials:true
        },
        //请求地址
        url:basePath2+"/api/member",
        //数据 ,json字符串
        //返回值的类型
        dataType:"json",
        data:obj,
        //请求成功
        success:function (result) {
            console.log(result);
            makeMemberInfoView(result);
        },
        //请求失败
        error:function (e) {
            console.log(e.status);
            console.log(e.responseText);
        }
    });
});

function makeMemberInfoView(result) {
    console.log("----------接口中获得session");
    console.log(result);
    let member = result.data;
    $("#levelName").text(member.levelName);
    $("#favourable").text(member.favourable);
    $("#memberName").val(member.memberName);
    $("#phone").val(member.phone);
    $("#zip").val(member.zip);
    $("#address").val(member.address);

}